import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-09-12
 * Time: 12:32
 */
//使用阻塞队列
public class Demo1 {
    public static void main(String[] args) throws InterruptedException {
        BlockingDeque<String> queue = new LinkedBlockingDeque<>();

        queue.put("hello");

        String elem = queue.take();
        System.out.println(elem);

        elem = queue.take();
        System.out.println(elem);

    }
}
